package sum;

import java.util.Scanner;

public class sum {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("please input the  number:");
		int num = in.nextInt();
		int sum = 0;
		int remainder;
		while (num!=0) {
			remainder=num%10;
			num =num/10;
			sum+=remainder;
		}
		System.out.println(sum);

	}

}
